﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ShadowEraDeckEditor
{
    public partial class FormSecurity : Form
    {
        int[] deckArray;

        public FormSecurity()
        {
            InitializeComponent();
        }

        private void buttonConvert_Click(object sender, EventArgs e)
        {
            string dstring = textBoxString.Text;
            string[] split = dstring.Split(',');
            int max = 0;
            foreach (string s in split)
            {
                int i;
                int.TryParse(s, out i);
                if (i > max)
                    max = i;
            }
            deckArray = new int[max+1];
            foreach (string s in split)
            {
                int i;
                int.TryParse(s, out i);
                deckArray[i] += 1;
            }
            textBoxCode.Text = DeckCode.INTtoC(deckArray);
            //((FormDeckBuilder)Owner).tempdeck = textBoxCode.Text;
        }

        private void buttonCopy_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(textBoxCode.Text);
        }
    }
}
